<?php
/**
 * Zend Framework Compatible PHP MSSQL Database Adapter
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.opensource.org/licenses/bsd-license.php
 *
 * @category    Adapters
 * @package     Db
 * @subpackage  Adapter_Sqlsrv
 * @copyright   Copyright (c) 2012 Zend Framework Compatible PHP MSSQL Database Adapter
 * @version     $Id: Sqlsrv.php 7 2012-05-24 09:46:02Z mail@henryhayes.co.uk $
 * @since       2012-05-24
 */
/**
 * Adapters_Db_Adapter_Sqlsrv class.
 *
 * This is a wrapping class for the missing elements of the Zend
 * Framework Sqlsrv database adapter that is not complete.
 *
 * @category    Adapters
 * @package     Db
 * @subpackage  Adapter_Sqlsrv
 * @copyright   Copyright (c) 2012 Zend Framework Compatible PHP MSSQL Database Adapter
 * @author      Henry Hayes <mail@henryhayes.co.uk>
 * @since       2012-05-24
 */
class Adapters_Db_Adapter_Sqlsrv extends Zend_Db_Adapter_Sqlsrv
{
    /**
     * Returns the column descriptions for a table.
     *
     * The return value is an associative array keyed by the column name,
     * as returned by the RDBMS.
     *
     * The value of each array element is an associative array
     * with the following keys:
     *
     * SCHEMA_NAME      => string; name of schema
     * TABLE_NAME       => string;
     * COLUMN_NAME      => string; column name
     * COLUMN_POSITION  => number; ordinal position of column in table
     * DATA_TYPE        => string; SQL datatype name of column
     * DEFAULT          => string; default expression of column, null if none
     * NULLABLE         => boolean; true if column can have nulls
     * LENGTH           => number; length of CHAR/VARCHAR
     * SCALE            => number; scale of NUMERIC/DECIMAL
     * PRECISION        => number; precision of NUMERIC/DECIMAL
     * UNSIGNED         => boolean; unsigned property of an integer type
     * PRIMARY          => boolean; true if column is part of the primary key
     * PRIMARY_POSITION => integer; position of column in primary key
     * IDENTITY         => integer; true if column is auto-generated with unique values
     *
     * @param string $tableName
     * @param string $schemaName OPTIONAL
     * @return array
     */
    public function describeTable($tableName, $schemaName = null)
    {
        if (!is_null($schemaName)) {
            $tableName = "{$schemaName}.{$tableName}";
        }

        return parent::describeTable($tableName);
    }
}